package com.artezio.testapp.service;
 
import java.util.List;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.artezio.testapp.dao.PersonDAO;
import com.artezio.testapp.domain.City;
import com.artezio.testapp.domain.Person;
 
 
@Service
public class PersonServiceImpl implements PersonService {
 
    @Autowired
    private PersonDAO personDAO;
    
    @Transactional
    public void addPerson(Person Person) {
    	personDAO.addPerson(Person);
    }
    
    @Transactional
    public List<Person> listPerson() {
    	return personDAO.listPerson();
    }
    
    @Transactional
    public List<Person> listPerson(String name, City city, Boolean philosopher) {
    	return personDAO.listPerson(name, city, philosopher);
    }
    
    @Transactional
    public Person getPerson(Integer id) {
    	return personDAO.getPerson(id);
    }
    
    @Transactional
    public void removePerson(Integer id) {
    	personDAO.removePerson(id);
    }
}
